package com.ssq.controller;

import com.ssq.enity.User;
import com.ssq.service.UserService;
import com.ssq.util.ResultMap;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

@Controller
@RequestMapping("/user")
public class UserController {
    @Autowired
    UserService userService;

    /**
     * 新增用户
     *
     * @return
     */
    @RequestMapping("/adduser")
    @ResponseBody
    public ResultMap adduser() {
        ResultMap resultmap = new ResultMap();
        User user = new User("admin", "000");
        userService.addUser(user);
        return resultmap;
    }

}
